3.163 \(\int \frac{\cos (c+d x)}{(a+i a \tan (c+d x))^4} \, dx\)

Optimal. Leaf size=134 \[ -\frac{4 \sin ^3(c+d x)}{63 a^4 d}+\frac{4 \sin (c+d x)}{21 a^4 d}+\frac{8 i \cos ^3(c+d x)}{63 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4} \]

[Out]

(4*Sin[c + d*x])/(21*a^4*d) - (4*Sin[c + d*x]^3)/(63*a^4*d) + ((I/9)*Cos[c + d*x])/(d*(a + I*a*Tan[c + d*x])^4
) + (((5*I)/63)*Cos[c + d*x])/(a*d*(a + I*a*Tan[c + d*x])^3) + (((8*I)/63)*Cos[c + d*x]^3)/(d*(a^4 + I*a^4*Tan
[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.120334, antiderivative size = 134, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {3502, 3500, 2633} \[ -\frac{4 \sin ^3(c+d x)}{63 a^4 d}+\frac{4 \sin (c+d x)}{21 a^4 d}+\frac{8 i \cos ^3(c+d x)}{63 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(4*Sin[c + d*x])/(21*a^4*d) - (4*Sin[c + d*x]^3)/(63*a^4*d) + ((I/9)*Cos[c + d*x])/(d*(a + I*a*Tan[c + d*x])^4
) + (((5*I)/63)*Cos[c + d*x])/(a*d*(a + I*a*Tan[c + d*x])^3) + (((8*I)/63)*Cos[c + d*x]^3)/(d*(a^4 + I*a^4*Tan
[c + d*x]))

Rule 3502

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(b*f*(m + 2*n)), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rule 3500

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(2*d^2
*(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 1))/(b*f*(m + 2*n)), x] - Dist[(d^2*(m - 2))/(b^2*(m + 2*n
)), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a
^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (Integers
Q[n, m + 1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]

Rule 2633

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rubi steps

\begin{align*} \int \frac{\cos (c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4}+\frac{5 \int \frac{\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx}{9 a}\\ &=\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{20 \int \frac{\cos (c+d x)}{(a+i a \tan (c+d x))^2} \, dx}{63 a^2}\\ &=\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{8 i \cos ^3(c+d x)}{63 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{4 \int \cos ^3(c+d x) \, dx}{21 a^4}\\ &=\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{8 i \cos ^3(c+d x)}{63 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{4 \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{21 a^4 d}\\ &=\frac{4 \sin (c+d x)}{21 a^4 d}-\frac{4 \sin ^3(c+d x)}{63 a^4 d}+\frac{i \cos (c+d x)}{9 d (a+i a \tan (c+d x))^4}+\frac{5 i \cos (c+d x)}{63 a d (a+i a \tan (c+d x))^3}+\frac{8 i \cos ^3(c+d x)}{63 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.190985, size = 95, normalized size = 0.71 \[ -\frac{i \sec ^4(c+d x) (-42 i \sin (c+d x)-135 i \sin (3 (c+d x))+35 i \sin (5 (c+d x))-168 \cos (c+d x)-180 \cos (3 (c+d x))+28 \cos (5 (c+d x)))}{1008 a^4 d (\tan (c+d x)-i)^4} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^4,x]

[Out]

((-I/1008)*Sec[c + d*x]^4*(-168*Cos[c + d*x] - 180*Cos[3*(c + d*x)] + 28*Cos[5*(c + d*x)] - (42*I)*Sin[c + d*x
] - (135*I)*Sin[3*(c + d*x)] + (35*I)*Sin[5*(c + d*x)]))/(a^4*d*(-I + Tan[c + d*x])^4)

________________________________________________________________________________________

Maple [A]  time = 0.104, size = 174, normalized size = 1.3 \begin{align*} 2\,{\frac{1}{{a}^{4}d} \left ({\frac{{\frac{43\,i}{3}}}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{6}}}-{\frac{4\,i}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{8}}}-{\frac{{\frac{49\,i}{4}}}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{4}}}+{\frac{{\frac{49\,i}{16}}}{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{2}}}+{\frac{8}{9\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{9}}}-{\frac{66}{7\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{7}}}+{\frac{31}{2\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{5}}}-{\frac{173}{24\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -i \right ) ^{3}}}+{\frac{31}{32\,\tan \left ( 1/2\,dx+c/2 \right ) -32\,i}}+1/32\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +i \right ) ^{-1} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a+I*a*tan(d*x+c))^4,x)

[Out]

2/d/a^4*(43/3*I/(tan(1/2*d*x+1/2*c)-I)^6-4*I/(tan(1/2*d*x+1/2*c)-I)^8-49/4*I/(tan(1/2*d*x+1/2*c)-I)^4+49/16*I/
(tan(1/2*d*x+1/2*c)-I)^2+8/9/(tan(1/2*d*x+1/2*c)-I)^9-66/7/(tan(1/2*d*x+1/2*c)-I)^7+31/2/(tan(1/2*d*x+1/2*c)-I
)^5-173/24/(tan(1/2*d*x+1/2*c)-I)^3+31/32/(tan(1/2*d*x+1/2*c)-I)+1/32/(tan(1/2*d*x+1/2*c)+I))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.32711, size = 248, normalized size = 1.85 \begin{align*} \frac{{\left (-63 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 315 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 210 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 126 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 45 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 7 i\right )} e^{\left (-9 i \, d x - 9 i \, c\right )}}{2016 \, a^{4} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/2016*(-63*I*e^(10*I*d*x + 10*I*c) + 315*I*e^(8*I*d*x + 8*I*c) + 210*I*e^(6*I*d*x + 6*I*c) + 126*I*e^(4*I*d*x
 + 4*I*c) + 45*I*e^(2*I*d*x + 2*I*c) + 7*I)*e^(-9*I*d*x - 9*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]  time = 1.6366, size = 233, normalized size = 1.74 \begin{align*} \begin{cases} \frac{\left (- 1585446912 i a^{20} d^{5} e^{26 i c} e^{i d x} + 7927234560 i a^{20} d^{5} e^{24 i c} e^{- i d x} + 5284823040 i a^{20} d^{5} e^{22 i c} e^{- 3 i d x} + 3170893824 i a^{20} d^{5} e^{20 i c} e^{- 5 i d x} + 1132462080 i a^{20} d^{5} e^{18 i c} e^{- 7 i d x} + 176160768 i a^{20} d^{5} e^{16 i c} e^{- 9 i d x}\right ) e^{- 25 i c}}{50734301184 a^{24} d^{6}} & \text{for}\: 50734301184 a^{24} d^{6} e^{25 i c} \neq 0 \\\frac{x \left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 9 i c}}{32 a^{4}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((-1585446912*I*a**20*d**5*exp(26*I*c)*exp(I*d*x) + 7927234560*I*a**20*d**5*exp(24*I*c)*exp(-I*d*x)
+ 5284823040*I*a**20*d**5*exp(22*I*c)*exp(-3*I*d*x) + 3170893824*I*a**20*d**5*exp(20*I*c)*exp(-5*I*d*x) + 1132
462080*I*a**20*d**5*exp(18*I*c)*exp(-7*I*d*x) + 176160768*I*a**20*d**5*exp(16*I*c)*exp(-9*I*d*x))*exp(-25*I*c)
/(50734301184*a**24*d**6), Ne(50734301184*a**24*d**6*exp(25*I*c), 0)), (x*(exp(10*I*c) + 5*exp(8*I*c) + 10*exp
(6*I*c) + 10*exp(4*I*c) + 5*exp(2*I*c) + 1)*exp(-9*I*c)/(32*a**4), True))

________________________________________________________________________________________

Giac [A]  time = 1.18235, size = 196, normalized size = 1.46 \begin{align*} \frac{\frac{63}{a^{4}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right )}} + \frac{1953 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{8} - 9450 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{7} - 25998 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} + 42210 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 46368 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 33054 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 15858 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 4374 i \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 703}{a^{4}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - i\right )}^{9}}}{1008 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/1008*(63/(a^4*(tan(1/2*d*x + 1/2*c) + I)) + (1953*tan(1/2*d*x + 1/2*c)^8 - 9450*I*tan(1/2*d*x + 1/2*c)^7 - 2
5998*tan(1/2*d*x + 1/2*c)^6 + 42210*I*tan(1/2*d*x + 1/2*c)^5 + 46368*tan(1/2*d*x + 1/2*c)^4 - 33054*I*tan(1/2*
d*x + 1/2*c)^3 - 15858*tan(1/2*d*x + 1/2*c)^2 + 4374*I*tan(1/2*d*x + 1/2*c) + 703)/(a^4*(tan(1/2*d*x + 1/2*c)
- I)^9))/d